﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Library;
using BusinessLayer;

public partial class Administrator_MemberManager : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        switch (e.CommandName)
        {
            case "Select":
                Member member = Member.GetOne(Convert.ToInt32(e.CommandArgument));
                txtEmail.Text = member.Member_Email;
                txtAddress.Text = member.Member_Address;
                txtTel.Text = member.Member_Tel.ToString();
                txtStatus.Text = member.Status.ToString();
                break;
            case "Delete":
                Member.Delete(Convert.ToInt32(e.CommandArgument.ToString()));
                Response.Redirect("MemberManager.aspx");
                break;
            case "Edit":
                Response.Redirect("MemberEdit.aspx?cmd=edit&Id=" + Convert.ToInt32(e.CommandArgument.ToString()));
                break;
        }
    }
}